Skip to content

Pin how a failure's cause and an absolute URL are reduced - #41

Merged
dmccoystephenson merged 1 commit into
mainfrom
feat/pin-cause-and-absolute-url
Nov 12, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feat/pin-cause-and-absolute-url

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Stage B (unit-test expansion) cycle: two existing behaviors that no test pinned are now characterized. No production code is changed.

  • describe() cause handling — names only an Error cause, one level deep, in the debug line. A failure whose cause is not an Error (a string) gets no cause text, and a cause's own cause is not followed: Error: fetch failed (outer), never (inner).
  • pagePath() on absolute URLs — keeps no credentials, host or port from an absolute URL, whatever the scheme's case. https://user:[email protected]:8443/account/?token=x gives /account; an upper-case HTTPS:// scheme is still recognized while the path keeps its case; an ftp:// URL is reduced the same way. This guards the README's "the path, and only the path" privacy claim against credentials or a host leaking into a page tag.

Test plan

  • CI test job green on the PR head (npm ci, npm run typecheck, npm test on Node 22), with the executed-test count two higher than on main
  • Local run not possible: Node is not available in the session that prepared this PR, so CI on the head SHA is the anchor.

Notes

  • No tracking issue: the gaps were found during triage while comparing the Stage B checklist against tests/trace-client.test.ts.
  • Skipped this cycle: An application name a header cannot carry drops every report #36 and A malformed enabled option fails open: only the literal false opts out #37 both wait on an owner decision, and changing either would mean a matching change in the Python and Java clients (the User-Agent header and the enabled opt-out semantics). They are left open for that reason.
  • Cross-client parity: no cross-client-visible behavior changed, so trace-client-python and trace-client-java need nothing.
  • CHANGELOG.md: no entry, since only tests changed and nothing a consumer vendors is affected.

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

🤖 Generated with Claude Code

A debug line names a failure's cause only when it is an Error, and only
the first one: a string cause is left out, and a cause's own cause is not
followed. pagePath() keeps nothing but the path of an absolute URL --
no credentials, host or port -- whatever the case of its scheme, and for
schemes other than http(s) too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (one pass, anchored on CI run 43147400772):

  • Scope: PASS — the diff is tests/trace-client.test.ts only (+28 lines), two new it blocks and nothing else.
  • Tests-new: PASS (n/a) — no public member was added; both tests exercise existing report()/describe() and pagePath() paths.
  • Tests-fix: n/a — no bug fix; both tests characterize current behavior and passed against unchanged production code.
  • Sibling structure: PASS — the new tests sit beside their neighbors (names the cause of a failed delivery… in TraceClient, falls back to the root… in pagePath), use the same stub-fetch/debug pattern, and hold their own assertion messages.
  • Sibling renames: n/a — nothing renamed.
  • Docs: PASS — no behavior changed. The new pagePath test backs the README's "the path, and only the path" claim; no doc row needs an update.
  • Issue resolution: n/a — no Closes; the gaps were found during triage. An application name a header cannot carry drops every report #36 and A malformed enabled option fails open: only the literal false opts out #37 were skipped because both wait on an owner decision and a matching change in the Python and Java clients.
  • CI: PASS — the test job is green on the head; # tests 82, # pass 82, # fail 0 (main: # tests 80), and both new subtests are listed as ok.
  • Zero-dependency: PASS — no imports were added; trace-client.ts and package.json were not touched.
  • Edge gate intact: PASS — tsconfig.json was not touched, and typecheck is green.
  • Never-throws / No console / Export surface / Version agreement: PASS — trace-client.ts was not touched.
  • Changelog: PASS (n/a) — nothing user-visible changed.
  • Cross-client parity noted: PASS — the PR body says no cross-client-visible behavior changed.

One judgment call was made. The describe() test pins the dropping of a string cause and of a nested cause, which is arguably a limit rather than a feature. It is pinned so that any widening of the debug text becomes a deliberate change. It is not treated as a bug, since the debug line only has to name the drop.

Local anchor: UNVERIFIED (Node is not installed in this session). CI on the exact head SHA served as the anchor instead.

This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit d8909f7 into main Nov 12, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feat/pin-cause-and-absolute-url branch November 12, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant